package de.upb.messerschmidt.set.entity;

import java.util.ArrayList;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * A Talk stores a {@link Person}s name as speaker and a list of
 * {@link Attendee}s which will be at the talk. Furthermore some usual data like
 * topic, the event it belongs to and it's description get stored.
 * 
 * 
 * @author Tim Messerschmidt
 * 
 */

@PersistenceCapable(detachable = "true")
public class Talk {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	@Persistent
	private String where;
	@Persistent
	private Date timeFrom;
	@Persistent
	private Date timeTo;
	@Persistent
	private String speaker;
	@Persistent
	private String topic;
	@Persistent
	private String description;
	@Persistent
	private String roomNr;
	@Persistent
	private ArrayList<String> attendees = new ArrayList<String>();

	/**
	 * @param where
	 *            the Talk's Event
	 * @param timeFrom
	 *            beginning of the Talk
	 * @param timeTo
	 *            end of the Talk
	 * @param speaker
	 *            who is speaking?
	 * @param topic
	 *            the Talk's title
	 * @param description
	 *            a short summary
	 * @param roomNr
	 *            where is the Talk?
	 */
	public Talk(String where, Date timeFrom, Date timeTo, String speaker,
			String topic, String description, String roomNr) {
		this.where = where;
		this.timeFrom = timeFrom;
		this.timeTo = timeTo;
		this.speaker = speaker;
		this.topic = topic;
		this.description = description;
		this.roomNr = roomNr;
	}

	/**
	 * @return the key
	 */
	public Key getKey() {
		return key;
	}

	/**
	 * @return the event
	 */
	public String getEvent() {
		return where;
	}

	/**
	 * @return the timeFrom
	 */
	public Date getTimeFrom() {
		return timeFrom;
	}

	/**
	 * @return the timeTo
	 */
	public Date getTimeTo() {
		return timeTo;
	}

	/**
	 * @return the speaker
	 */
	public String getSpeaker() {
		return speaker;
	}

	/**
	 * @return the topic
	 */
	public String getTopic() {
		return topic;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @return the where
	 */
	public String getWhere() {
		return where;
	}

	/**
	 * @return the roomNr
	 */
	public String getRoomNr() {
		return roomNr;
	}

	/**
	 * @return the attendees
	 */
	public ArrayList<String> getAttendees() {
		return attendees;
	}

	/**
	 * @param key
	 *            the key to set
	 */
	public void setKey(Key key) {
		this.key = key;
	}

	/**
	 * @param timeFrom
	 *            the timeFrom to set
	 */
	public void setTimeFrom(Date timeFrom) {
		this.timeFrom = timeFrom;
	}

	/**
	 * @param timeTo
	 *            the timeTo to set
	 */
	public void setTimeTo(Date timeTo) {
		this.timeTo = timeTo;
	}

	/**
	 * @param speaker
	 *            the speaker to set
	 */
	public void setSpeaker(String speaker) {
		this.speaker = speaker;
	}

	/**
	 * @param topic
	 *            the topic to set
	 */
	public void setTopic(String topic) {
		this.topic = topic;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @param where
	 *            the where to set
	 */
	public void setWhere(String where) {
		this.where = where;
	}

	/**
	 * @param roomNr
	 *            the roomNr to set
	 */
	public void setRoomNr(String roomNr) {
		this.roomNr = roomNr;
	}

	/**
	 * @param attendees
	 *            the attendees to set
	 */
	public void setAttendees(ArrayList<String> attendees) {
		this.attendees = attendees;
	}
}
